package com.lmm.lcuser.lc_user.plugins;

import com.facebook.react.bridge.Callback;
import com.lmm.dresswisdom.lmmframe.reactnative.BasePlugin;
import com.lmm.dresswisdom.lmmframe.reactnative.annotation.RNPlugin;
import com.lmm.lcuser.lc_user.MainActivity;

import java.util.Map;

/**
 * @author xmgong
 * @date 2017/11/29
 * 富文本编辑器
 */
@RNPlugin(method = "editRichContent")
public class EditRichContentPlugin extends BasePlugin<MainActivity> {
    String title = "";
    String value = "";
    String filetag = "";

    public EditRichContentPlugin(MainActivity act) {
        super(act);
    }

    @Override
    protected void doAction(Map<String, Object> map, Callback callback) {
        if (map.containsKey("title")) {
            title = map.get("title").toString();
        }
        if (map.containsKey("value")) {
            value = map.get("value").toString();
        }
        if (map.containsKey("filetag")) {
            filetag = map.get("filetag").toString();
        }

//        ARouter.getInstance().build("/app/richtxt/main")
//                .withString("title", title)
//                .withString("richtxt_str", value)
//                .withString("filetag", filetag).navigation(activity, ReqCodeValue.ReqCode_EditRichTxt);
    }
}
